﻿using AutoMapper;
using Travel.API.Dto;
using Travel.API.Models;

namespace Travel.API.Profiles
{
    public class TouristRouteProfile : Profile
    {
        public TouristRouteProfile()
        {
            CreateMap<TouristRoute, TouristRouteDto>()

                .ForMember(
                dest => dest.DiscountPrice,
                opt => opt.MapFrom(src => src.Price * (src.Discount == 0 ? 1 : src.Discount)));




        }
    }
}
